<template>
    <div class='right'>
        <index-header></index-header>
        <div class='position'>
            <sec-left :nav='this.$store.state.WechatNav'></sec-left>
            
                <div class='container'>
                    <h1 class='title'>
                        <i class='el-icon-warning'></i>
                        <span>所有客户信息</span>
                    </h1>
                    <el-button 
                    class='add' 
                    type="primary" 
                    icon="el-icon-edit"
                    @click='addProduct()'>新增</el-button>
                    <div class='tableBody'>
                        <list-table></list-table>
                    </div>    
                </div>
        </div>
        
        
    </div>
</template>


<script>
import IndexLeft from 'index/components/Left'
import IndexHeader from 'index/components/Header'
import SecLeft from 'index/cms/components/SecLeft'
import ListTable from './components/Table'
import { mapMutations } from 'vuex'
import { mapState } from 'vuex'
export default{
    name:'CMSList',
    components:{
        IndexHeader,
        IndexLeft,
        SecLeft,
        ListTable
    },
    data (){
        return {
            
        }
    },
    computed: {
        ...mapState(['defaultActive'])
    },
    methods: {
        addProduct (){
            this.$router.push('/CMS/CMSAdd')          
            this.changeActive('/CMS/CMSAdd')          
        },
        changeActive(path){
        
          this.changeActive(path)
        },
        ...mapMutations(['changeActive'])
    },
}
</script>

<style lang="stylus" scoped>
@import '~styles/varibles.styl'
.right
    float left
    width 90%
    
    .position
        position relative
        overflow hidden
        .container
           
            float right
            width $rightContainer
           
            background white
            border-radius 10px
            margin-top 10px
            margin-right 16px
            
            .title
                font-size 18px
                width 98%
                margin 1%
                border-bottom 1px solid #eef1f5
                padding-bottom 20px
                .el-icon-warning
                    color #409EFF
            .add
                margin-left 2%   
            .tableBody
                margin 1% 2% 1% 2%
                width 96%         
</style>
